<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    .outer {
      width: 500px;
      height: 500px;
      background-color: pink;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: auto;
    }

    .center {
      width: 300px;
      height: 300px;
      background-color: skyblue;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: auto;
    }

    .inner {
      width: 100px;
      height: 100px;
      background-color: orange;
      position: absolute;
      top: 0;
      left: 600px;
      right: 0;
      bottom: 0;
      margin: auto;
    }

    p {
      width: 100px;
      height: 100px;
      background-color: purple;
      position: absolute;
      left: 600px;
      top: 500px;
    }
  </style>
</head>
<body>

  <div class="outer">
    <div class="center">
      <div class="inner"></div>
    </div>
  </div>

  <p></p>

  <ul>
  

  <script>
    // inner center  outer  body  html  document  window

    // 事件传播 事件冒泡 事件捕获

    document.querySelector('.inner').addEventListener('click',function(e){
        console.log('inner')
        e.stopPropagation();
    });
    document.querySelector('.center').addEventListener('click',function(e){
        console.log('center');
        e.stopPropagation();
    });
    document.querySelector('.outer').addEventListener('click',function(e){
        console.log('outer')
        e.stopPropagation();
    });
    document.body.addEventListener('click',function(e){
        console.log('body');
        e.stopPropagation();
    });
    document.documentElement.addEventListener('click',function(e){
        console.log('html');
        e.stopPropagation(e);
    });
    document.addEventListener('click',function(e){
        console.log('document');
        e.stopPropagation();
    });
    window.addEventListener('click',function(e){
        console.log('window');
        e.stopPropagation();
    });



  </script>

</body>
</html>